def electron_confirm(n):
    order = ['s', 'p', 'd', 'f']  # s, p, d, f的顺序填充
    max_electrons = {
        's': 2,
        'p': 6,
        'd': 10,
        'f': 14,
    }
    # 初始化电子排布字典
    result = {}
    current_shell = 1
    current_subshell = 's'
    last_subshell = 's'
    for i in range(1, n + 1):
        if result.get(current_shell, {}).get(current_subshell, 0) < max_electrons[current_subshell]:
            # 如果当前能级未满，则填充电子
            if current_shell not in result:
                result[current_shell] = {}
            result[current_shell][current_subshell] = result[current_shell].get(current_subshell, 0) + 1
        else:
            # 如果当前能级已满，则转到下一个能级
            # s, p, d, f 顺序循环，每个能层最多有4个能级（除了第一层只有s）
            if (current_subshell == 's'):
                last_subshell = current_shell
                current_shell = int(((last_subshell + 1) / 2) + 1)
                row = int((last_subshell / 2) + 1)
                current_subshell = order[row - 1]
            else:
                current_shell += 1
                row = order.index(current_subshell)
                current_subshell = order[row - 1]
            # 如果当前能级未满，则填充电子
            if current_shell not in result:
                result[current_shell] = {}
            if result.get(current_shell, {}).get(current_subshell, 0) < max_electrons[current_subshell]:
                result[current_shell][current_subshell] = result[current_shell].get(current_subshell, 0) + 1
    # 格式化输出
    for shell,subshells in result.items():
        for subshell,count in subshells.items():
            print(f"{shell}{subshell}{count}", end=' ')
        print()
    # print(result)
# 输入电子数
n = int(input().strip())
electron_confirm(n)
